package com.robert.mapper;

import com.robert.entity.BlogEntity;
import com.robert.util.Pager;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *
 * </p>
 *
 * @author robert zhao
 * @since 2020/5/6
 */
@Mapper
public interface BlogMapper {

  @Select("select title, content, created createTime from t_article limit #{pager.startIndex}, #{pager.lastIndex}")
  List<BlogEntity> selectList(@Param("pager") Pager pager);

  @Select("select count(1) from t_article")
  Integer count();
}
